<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>

<?php 
	$ci = &get_instance();
	$ESCORT = $ci->escort_entity->init('user_id',$USER->getId());
	
	$cityArray = getCityData_ioc($country_id=$USER->getCountryId(), $state_id =$USER->getStateId(), $province_id =$USER->getProvinceId());
?>

<?php if($pos == 'top'):?>
	<div class="background-images-slideshow-wrapper">
		<div class="carousel js background-images-slideshow">
			<ul>
				<?php foreach($ci->media_entity->getMediaByPermission($USER->getId(),'public_top') as $item):?>
					<?php $MEDIA = $ci->media_entity->init('id', $item->id) ;?>
					<?php if($MEDIA->getType() == 'image'):?>
						<li>
							<?php echo thumb($MEDIA->getTargetFile('image'), PUBLIC_TOP_W, PUBLIC_TOP_H);?>
						</li>
					<?php else: ?>
						<div>	
							<?php echo playvideo($MEDIA->getTargetFile('video'),$MEDIA->getTargetFile('avatar'),PUBLIC_TOP_W, PUBLIC_TOP_H);?>
						</div>
					<?php endif;?>
				<?php endforeach; ?>	
			</ul>
		</div>
		<div class="escort-sheet-info-top-navigation">
			<div class="escort-sheet-info-phone">
				<a href="javascript:void(0);"><img src="{{url:base}}media/img/phone.png" /></a>
			</div>
			<div class="escort-navigation-wrapper">
				<div class="escort-name">
					<span class="name"><?php echo strtoupper($USER->getName());?></span>
					<span class="address"><?php echo language_translate('myzone_page_escort_in').' '.$cityArray[$USER->getCityId()];?></span>
				</div>
				<div class="escort-navigation">
					<!--
						<a href=""><img src="{{url:base}}media/img/pre-buton.png" /></a><a href=""><img src="{{url:base}}media/img/next-button.png" /></a>
					-->
				</div>
				<div class="clear"></div>
				<div class="order-number">
					<!--
						<span>3 de 395</span>
					-->
				</div>
			</div>
			<div class="clear"></div>
		</div>
		<?php if($ESCORT->getPublicLanguageIds() == 1):?>
			<div class="introduction-text">
				<a class="ui-dialog-titlebar-close ui-corner-all" href="javascript:void(0);" role="button">
					<span class="ui-icon ui-icon-closethick" style="position:absolute;top:0;right:0;">close</span>
				</a>
				<?php echo $ESCORT->getDescription(get_language_id(),$ESCORT->getUserId());?>
			</div>
		<?php endif; ?>
		
		<div id="open-introduction-text" title="<?php echo language_translate('myzone_page_open_introduction_text'); ?>">123</div>
	</div>
<?php endif; ?>

<?php if($pos == 'bottom'):?>
	<div class="carousel js image-slideshow">
		<ul>
			<?php foreach($ci->media_entity->getMediaByPermission($USER->getId(), 'public') as $item):?>
				<?php $MEDIA = $ci->media_entity->init('id',$item->id);?>
					<?php if($MEDIA->getType() == 'image'):?>
						<li>	
							<?php echo thumb($MEDIA->getTargetFile('image'),PUBLIC_W,PUBLIC_H);?>
						</li>
					<?php else:?>
						<li>	
							<?php echo playvideo($MEDIA->getTargetFile('video'),$MEDIA->getTargetFile('avatar'),PUBLIC_W,PUBLIC_H);?>
						</li>
					<?php endif;?>
			<?php endforeach;?>
		</ul>
	</div>
<?php endif; ?>